﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.Logging;
using Prism.Regions;
using System.Collections.ObjectModel;
using System.IO;
using VisionApp.Core.Models;
using VisionApp.Startup.Models;
using VisionApp.Startup.Services;
using VM.Core;
using VM.PlatformSDKCS;

namespace VisionApp.Startup.ViewModels;

public partial class MainWindowViewModel:ObservableObject
{
    public event EventHandler<string> OnSolutionLoaded;

    private readonly CommunicationService communicationService;
    private readonly ILogger<MainWindowViewModel> logger;

    [ObservableProperty]
    private string? _logInfos;
    [ObservableProperty]
    private bool _isPlcConnected;

    public MainWindowViewModel(CommunicationService communicationService,ILogger<MainWindowViewModel> logger)
    {
        this.communicationService = communicationService;
        this.communicationService.OnIsConnectedChanged += (sender, e) => IsPlcConnected = e;
        this.logger = logger;


    }


}